package fr.mairie.parc.control.user;

import java.util.Map;

import org.apache.click.Context;
import org.apache.click.Page;
import org.apache.click.control.Panel;
import org.apache.click.util.HtmlStringBuffer;

import fr.mairie.parc.domain.User;

public class UserPanel extends Panel {

	/**
	 *
	 */
	private static final long serialVersionUID = 1L;

	private User user;

	public UserPanel (Page page, User user) {
		this.user = user;
		setParent(page);
	}

    @SuppressWarnings({ "unchecked", "rawtypes" })
	@Override
    public void render(HtmlStringBuffer buffer) {
        Context context = getContext();
        Map templateModel = createTemplateModel();
        templateModel.put("user", user);
        buffer.append(context.renderTemplate("/user/user-detail.htm", templateModel));
    }

}
